
    const WangEditor = window.wangEditor

    function creatWangEditor (id) {
    let text_id = "text_"+id;

    let old_text = $("#"+id).html();
    $("#"+id).empty();

    $('#'+id).append(`<input name="${id}" type="hidden" />`);
    $(`input[name=${id}]`).val(old_text);

    let new_wrap = "wrap_" +id;
    $('#'+id).append(`<div id="${new_wrap}"  ></div>`);


    const editor = new WangEditor('#'+new_wrap)
    editor.config.uploadImgServer = '上传图片地址'
    editor.config.onchange = function (newHtml) {
    $(`input[name=${id}]`).val(newHtml);

}
    editor.create()
    editor.txt.html(old_text)


}

